<nz-modal [(nzVisible)]="visible" [nzTitle]="modalTitle" [nzContent]="modalContent" [nzFooter]="modalFooter" [nzMaskClosable]="false" [nzWidth]="600" (nzOnCancel)="hide()">
    <form #myForm="ngForm" role="form">
        <ng-template #modalTitle>
            客户信息
        </ng-template>

        <ng-template #modalContent>
            <div class="grid-auto-row" *ngIf="object">
                <nz-form-item>
                    <nz-form-label [nzSpan]="6" nzFor="name">客户名称</nz-form-label>
                    <nz-form-control [nzSpan]="14">
                      <input nz-input name="name" type="text" [(ngModel)]="object.name" required>
                    </nz-form-control>
                </nz-form-item>
                <nz-form-item>
                    <nz-form-label [nzSpan]="6" nzFor="level">客户级别</nz-form-label>
                    <nz-form-control [nzSpan]="14">
                        <nz-select name="level" [(ngModel)]="object.level" required>
                            <nz-option [nzValue]="0" nzLabel="普通客户"></nz-option>
                            <nz-option [nzValue]="1" nzLabel="优惠客户"></nz-option>
                            <nz-option [nzValue]="2" nzLabel="VIP客户"></nz-option>
                        </nz-select>
                    </nz-form-control>
                </nz-form-item>
                <nz-form-item>
                    <nz-form-label [nzSpan]="6" nzFor="person"> 联系人</nz-form-label>
                    <nz-form-control [nzSpan]="14">
                      <input nz-input name="person" type="text" [(ngModel)]="object.person">
                    </nz-form-control>
                </nz-form-item>
                <nz-form-item>
                    <nz-form-label [nzSpan]="6" nzFor="phone">联系电话</nz-form-label>
                    <nz-form-control [nzSpan]="14">
                      <input nz-input name="phone" type="text" [(ngModel)]="object.phone">
                    </nz-form-control>
                </nz-form-item>
            </div>
        </ng-template>

        <ng-template #modalFooter>
            <button nz-button nzType="default" (click)="hide()">取消</button>
            <button nz-button (click)="submit()" [disabled]="!myForm.form.valid">保存</button>
        </ng-template>
    </form>
</nz-modal>
